-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user`
(
    `id`                bigint       NOT NULL AUTO_INCREMENT COMMENT '用户ID',
    `username`          varchar(32)  NOT NULL COMMENT '用户名',
    `pwd`               varchar(512) NOT NULL COMMENT '密码',
    `phone`             varchar(20)      DEFAULT NULL COMMENT '手机号',
    `nickname`          varchar(32)      DEFAULT NULL COMMENT '昵称',
    `sex`               tinyint(1)       DEFAULT NULL COMMENT '性别(0 未知 1 男 2 女)',
    `birthday`          varchar(255)     DEFAULT NULL COMMENT '生日',
    `logo`              varchar(255)     DEFAULT NULL COMMENT '头像地址',
    `age`               int              DEFAULT NULL COMMENT '年龄，--废弃，以生日为主',
    `id_card`           varchar(32)      DEFAULT NULL COMMENT '身份证',
    `email`             varchar(256)     DEFAULT NULL COMMENT '邮箱地址',
    `account_status_cd` varchar(10)      DEFAULT NULL COMMENT '账户状态 (如 冻结；禁言；正常。 关联字典表account_status)',
    `user_tag_cd`       varchar(255)     DEFAULT '' COMMENT '标签（自定义关联到字典表）',
    `last_login_time`   datetime         DEFAULT NULL COMMENT '最近一次登录时间',
    `created_at`        datetime         DEFAULT NULL COMMENT '创建时间',
    `updated_at`        datetime         DEFAULT NULL COMMENT '更新时间',
    `deleted`           tinyint unsigned default 0 COMMENT '是否删除',
    `created_by`        bigint           DEFAULT NULL COMMENT '创建人ID',
    `updated_by`        bigint           DEFAULT NULL COMMENT '更新人ID',
    PRIMARY KEY (`id`) USING BTREE,
    KEY `username_index` (`username`) USING BTREE,
    KEY `create_time_index` (`created_at` DESC) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 7
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_general_ci
  ROW_FORMAT = DYNAMIC COMMENT ='系统用户表';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (1, 'admin', '$2a$10$lv0HmNLnLrKzfzrFNWc.ku3MFBM5.XsPvTdbz71gLogv.mSbvDN5S', '19988887777', '系统管理员', 1,
        '2022-01-01', 'https://minioapi.szadmin.cn/test/user/20241216/微信图片_20240420160033.jpg', 1, '', '',
        '1000001', '1001002', '2024-02-02 13:36:04', '2023-08-18 11:15:10', '2025-01-18 09:25:39', 0, NULL, NULL);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (2, 'user', '$2a$10$Km4pU/DdW/.LXRYgR446S.HCdcjIHkp7uFisXtCVoaXyXfveBHjlO', NULL, '测试用户', 1, '2024-01-01',
        NULL, 0, NULL, NULL, '1000001', '1001003', NULL, '2024-05-09 21:50:02', '2024-05-10 22:30:54', 0, NULL, NULL);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (3, 'test1', '$2a$10$QXRq4OGoHahxlXbULJxIXe0RgOCdW7C716bes9qh4gopIVROAVxXW', '', '测试1-本部及以下', NULL, '',
        '', 0, '', '', '1000001', '1001003', NULL, '2024-07-08 08:47:31', '2024-07-08 09:17:41', 0, 1, 1);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (4, 'test2', '$2a$10$uMZA6KiYtvnLVHSukXiB2ufvKdp827nO/6p6jWn1ydEYoLA0kgPqK', '', '测试2-仅本部', NULL, '', '', 0,
        '', '', '1000001', '1001003', NULL, '2024-07-08 08:47:41', '2024-07-08 09:17:11', 0, 1, 1);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (5, 'test3', '$2a$10$UWKoQfMAFxk/qdTI4vQLgOjho5xtjNJhdbHmJNoYuNZkuOq2WCoZm', '', '测试3-仅本人', NULL, '', '', 0,
        '', '', '1000001', '1001003', NULL, '2024-07-08 08:47:50', '2024-07-08 09:17:56', 0, 1, 1);
INSERT INTO `sys_user` (`id`, `username`, `pwd`, `phone`, `nickname`, `sex`, `birthday`, `logo`, `age`, `id_card`,
                        `email`, `account_status_cd`, `user_tag_cd`, `last_login_time`, `created_at`, `updated_at`,
                        `deleted`, `created_by`, `updated_by`)
VALUES (6, 'test4', '$2a$10$bCgJMtfSPhn6Mvn2AGx5z.NDVHXBvxl7/XEvlH52wbBpAWkLvwVVe', '', '测试4-自定义', NULL, '', '', 0,
        '', '', '1000001', '1001003', NULL, '2024-07-08 08:47:58', '2024-07-08 09:18:33', 0, 1, 1);
COMMIT;